import Mock from 'mockjs'
import dataFunc from './dataFunc'

const { arr1, arr2 } = dataFunc.homeData()

const userData = Mock.mock({
    'data|100':[ // 随机假数据
        {
            id: '@guid()', // 用户id
            username: "@word(4,12)", // 用户名
            nickname: '@clast(1,12)', // 随机昵称
            name: '@cname', // 姓名
            phone: /^1[34578]\d{9}$/, //电话号码
            email:'@email',//邮箱
            sex(){ // 用户性别
                return Mock.Random.boolean() ? '男' : '女'
            },
            address: '@county(true)', //地址
            createTime: '@datetime', //注册时间
            info() { // 用户简介
                return Mock.Random.cparagraph()
            },
            avatar() { //用户头像
                return Mock.Random.image('100×100', Mock.Random.color(), '#FFF', this.nickname).replace(
                    '×',
                    'x'
                )
            },
            'state|0-1':1, // 用户状态
        }
    ],
})

export default {
    homeData:{
        tableData:[ // 表格数据
            {
                name:'张飞',
                kills: 34,
                altogether:3500,
                grade:5,
            },
            {
                name:'赵云',
                kills: 65,
                altogether:5621,
                grade: 9,
            },
            {
                name:'曹操',
                kills: 35,
                altogether:6540,
                grade:10,
            },
            {
                name:'黄忠',
                kills: 22,
                altogether:5401,
                grade:8,
            },
            {
                name:'刘备',
                kills: 68,
                altogether:7109,
                grade:11,
            },
            {
                name:'李逵',
                kills: 35,
                altogether:4620,
                grade:7,
            },
        ],
        countData:[ // 卡片数据
            {
                label:'我方今日杀敌',
                value: 3564,
                icon:'Share',
                color:'#22b8cc',
            },
            {
                label:'我方今日伤员',
                value: 1554,
                icon:'Share',
                color:'#ffbc7d',
            },
            {
                label:'我方今日阵亡',
                value: 1351,
                icon:'Share',
                color:'#51adf2',
            },
            {
                label:'敌方今日杀敌',
                value: 1562,
                icon:'Share',
                color:'#22b8cc',
            },
            {
                label:'敌方今日伤员',
                value: 2348,
                icon:'Share',
                color:'#ffbc7d',
            },
            {
                label:'敌方今日阵亡',
                value: 1563,
                icon:'Share',
                color:'#51adf2',
            },
        ],
        echartsData:{ // 图表数据
            date:['-384-04-06','-384-04-07','-384-04-08','-384-04-09','-384-04-10','-384-04-11'],
            data:arr1,
            userData:arr2,
        },
    },
    userData, // 用户数据
}